Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

STM32 : Add default deep sleep latency of 3ms #8798

Merged
merged 1 commit into from
Nov 30, 2018

Conversation

jeromecoutant
Copy link
Collaborator

@jeromecoutant jeromecoutant commented Nov 19, 2018

Description

Feature has been introduced in #8223
Discussion on ST impacts started there: #8223 (comment)

@c1728p9 @LMESTM

Here is some quick measurement between the end of deep sleep (CPU) and the end of hal_deepsleep function:

  • NUCLEO_F401 : 824 us
  • NUCLEO_L476 : 2.04 ms
  • NUCLEO_L073 : 1.02 ms

So we propose to set as default value a deep sleep latency of 2ms.

Value can be overwritten in your target anyway:

"overrides": { "deep-sleep-latency": 5 },
or "overrides": { "deep-sleep-latency": 0 },

Pull request type

[x] Fix
[ ] Refactor
[ ] Target update
[ ] Functionality change
[ ] Docs update
[ ] Test update
[ ] Breaking change

@0xc0170 0xc0170 requested review from c1728p9 and a team November 19, 2018 13:37
@0xc0170
Copy link
Contributor

0xc0170 commented Nov 19, 2018

Q: 2s or 2ms? Reading the code , I believe it is milliseconds

@jeromecoutant jeromecoutant changed the title STM32 : Add default deep sleep latency of 2s STM32 : Add default deep sleep latency of 2ms Nov 19, 2018
@jeromecoutant
Copy link
Collaborator Author

Update done 😕

@mattbrown015
Copy link
Contributor

@jeromecoutant How did you make your measurements?

I'd like to repeat your tests on my STM32L442. :-)

@jeromecoutant
Copy link
Collaborator Author

I set a GPIO to 1 at STOP mode exit and
0 at at the end of hal_deepsleep() in order to measure with a probe.

@mattbrown015
Copy link
Contributor

@jeromecoutant

I set a GPIO to 1 at STOP mode exit and
0 at at the end of hal_deepsleep() in order to measure with a probe.

Pretty simple! I can give that a go. :-)

@mattbrown015
Copy link
Contributor

@jeromecoutant The STM32L442 appears to be practically the same as the L476.

I measured 2.25 ms but assume the extra 0.2 ms is not a surprise or a concern. :-)

@LMESTM
Copy link
Contributor

LMESTM commented Nov 22, 2018

@mattbrown015 interesting anyhow :-)
I think it's best to be pessimistic in the wake-up time.
If the core OS knows that something needs to be scheduled in 2.5ms, then better to avoid entering it ...
the energy spent in entering the mode and exiting immediately might even be more than what we save.
So I'd even make it up to 3ms and avoid side effects.

@LMESTM
Copy link
Contributor

LMESTM commented Nov 27, 2018

@jeromecoutant maybe change the PR title to 3ms before it gets merged ?

@jeromecoutant jeromecoutant changed the title STM32 : Add default deep sleep latency of 2ms STM32 : Add default deep sleep latency of 3ms Nov 27, 2018
@0xc0170
Copy link
Contributor

0xc0170 commented Nov 30, 2018

CI started

@mbed-ci
Copy link

mbed-ci commented Nov 30, 2018

Test run: SUCCESS

Summary: 4 of 4 test jobs passed
Build number : 1
Build artifacts
Build logs

@cmonr cmonr merged commit 0b6ce4b into ARMmbed:master Nov 30, 2018
@jeromecoutant jeromecoutant deleted the PR_LATENCY branch January 17, 2019 12:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants